package com.example.cloud.model.business.medical;

import com.example.cloud.model.common.CommonModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.math.BigDecimal;

/**
 * Created by wangtao on 2018/7/2.
 * 单次治疗产品
 */
@Entity(name = "treat_plan_product")
@Data
@EqualsAndHashCode(callSuper = false)
public class TreatPlanProduct extends CommonModel {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    // 患者主键
    @Column(name = "patient_id")
    private Long patientId;
    // 会员主键
    @Column(name = "member_id")
    private Long memberId;
    // 主诉ID
    @Column(name = "complaint_id")
    private Long complaintId;
    // 产品ID
    @Column(name = "product_id")
    private Long productId;
    // 产品名称
    @Column(name = "product_name")
    private String productName;
    // 项目ID
    @Column(name = "project_id")
    private Long projectId;
    // 项目名称
    @Column(name = "project_name")
    private String projectName;
    // 单价
    @Column(name = "price", precision = 12, scale = 2)
    private BigDecimal price;
    // 总数量
    @Column(name = "quantity")
    private int quantity;
    // 使用次数
    @Column(name = "execute", columnDefinition = "INT DEFAULT 0")
    private int execute;
    // 总价
    @Column(name = "total_price", precision = 12, scale = 2)
    private BigDecimal totalPrice;
    // 医嘱备注
    @Column(name = "medical_advice")
    private String medicalAdvice;
    // 收费状态{0：未收费 1：已收费}
    @Column(name = "charge_status", columnDefinition = "INT DEFAULT 0")
    private int chargeStatus;
    // 状态
    @Column(name = "status", columnDefinition = "INT DEFAULT 1")
    private int status;
    // 本次使用
    @Transient
    private int useQuantity;
}
